package com.rq.viewtestapplication;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;

import com.rq.viewtestapplication.manager.ActionManager;

public class MainActivity extends AppCompatActivity implements View.OnLongClickListener {
    ActionManager actionManager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        actionManager = ((MindPanViewGroup) findViewById(R.id.pan)).getActionManager();
//        BaseAdapter adapter = new BaseAdapter(this, R.layout.item_test) {
//            @Override
//            protected void onBindEasyHolder(BaseAdapter adapter, BaseViewHolder holder, int position, Object o) {
//                super.onBindEasyHolder(adapter, holder, position, o);
//                holder.setItemText(R.id.tv, (String) o);
//            }
//        };
//        RecyclerView recyclerView = findViewById(R.id.recycler);
//        new RecyclerUtil(adapter).set2View(recyclerView);
//        List<String> debugPaint = new ArrayList<>();
//        debugPaint.add("1");
//        debugPaint.add("12");
//        debugPaint.add("13");
//        debugPaint.add("41");
//        debugPaint.add("15");
//        debugPaint.add("16");
//        debugPaint.add("2");
//        debugPaint.add("22");
//        debugPaint.add("23");
//        debugPaint.add("21");
//        debugPaint.add("25");
//        debugPaint.add("26");
//        adapter.setData(debugPaint);
//        recyclerView.setOnLongClickListener(this);
    }

    @Override
    public boolean onLongClick(View v) {
        LOG.e("MainActivity", "LIFE:onLongClick");
        return true;
    }

    public void rollback(View view) {
        actionManager.rollback();
    }

    public void addOne(View view) {
        actionManager.addOne();
    }
}
